package cn.nit.blog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by wjx on 2023/3/21 15:46
 */

@Controller
public class PageController {

    @RequestMapping("/{page}.html")
    public String pageRouter1(@PathVariable String page){
        System.out.println(page);
        return page;
    }

    @RequestMapping("/{path}/{page}.html")
    public String pageRouter2(@PathVariable String path,@PathVariable String page){
        System.out.println("path = "+path);
        System.out.println("page = "+page);
        return path+"/"+page;
    }
}
